package com.leyou.item.mapper;

import com.leyou.common.mappers.BaseMapper;
import com.leyou.item.entity.Category;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.additional.idlist.IdListMapper;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * @author jinpei
 * @version v1.0
 * @date 2019/5/5 19:24
 * @description TODO
 **/
public interface CategoryMapper extends BaseMapper<Category> {

    @Select("SELECT tc.id ,tc.`name`,tc.parent_id,tc.is_parent,tc.sort FROM tb_category_brand tcb LEFT JOIN tb_category tc ON tcb.category_id = tc.id WHERE tcb.brand_id = #{id}")
    List<Category> queryCategoryByBrandId(@Param("id") Long id);
}
